package gemini.basic.model;
// default package
// Generated Nov 23, 2010 4:23:01 PM by Hibernate Tools 3.4.0.Beta1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

/**
 * SystemParam generated by hbm2java
 */
@Entity
@Table(name = "g_system_param", catalog = "gemini", uniqueConstraints = {
		@UniqueConstraint(columnNames = "code")})
public class SystemParam extends AbstractDomain implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	
	private Integer id;
	private Integer version;
	private SystemParamType systemParamType;
	private SystemParamValue systemParamValue;
	private String code;
	private Date validFrom;
	private Date validTo;
	private String description;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Version
	@Column(name = "version")
	public Integer getVersion() {
		return this.version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "type_id", nullable = false)
	public SystemParamType getSystemParamType() {
		return this.systemParamType;
	}

	public void setSystemParamType(SystemParamType systemParamType) {
		this.systemParamType = systemParamType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "value_id", nullable = false)
	public SystemParamValue getSystemParamValue() {
		return this.systemParamValue;
	}

	public void setSystemParamValue(SystemParamValue systemParamValue) {
		this.systemParamValue = systemParamValue;
	}

	@Column(name = "code", unique = true, nullable = false, length = 20)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "valid_from", nullable = false, length = 10)
	public Date getValidFrom() {
		return this.validFrom;
	}

	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "valid_to", length = 10)
	public Date getValidTo() {
		return this.validTo;
	}

	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}

	@Column(name = "description", length = 100)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}
